﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

public partial class LoginPage : System.Web.UI.Page
{
    

    
    protected void ButtonSignUp_Click(object sender, EventArgs e)
    {
        string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; 
        using (SqlConnection con = new SqlConnection(CS))
        {
            SqlCommand cmd = new SqlCommand("spAddUser", con);
            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@Name", TextBoxName.Text);
            cmd.Parameters.AddWithValue("@UserName", TextBoxUserName.Text);
            cmd.Parameters.AddWithValue("@DOB", TextBoxDOB.Text);
            cmd.Parameters.AddWithValue("@Division", DropDownListDivision.SelectedValue);
            cmd.Parameters.AddWithValue("@Position", DropDownListPosition.SelectedValue);
            cmd.Parameters.AddWithValue("@Email", TextBoxEmail.Text);
            cmd.Parameters.AddWithValue("@LogPass", TextBoxPass.Text);

            con.Open();
            cmd.ExecuteNonQuery();

            LabelRegStatus.Text = "Registration Successful!";
            Response.Redirect("LoginPage.aspx");

        }
    }
    protected void TextBoxName_TextChanged(object sender, EventArgs e)
    {

    }
}